Skip to content

Conversation

FabianLars
Copy link
Member

follow up to #2624

@FabianLars FabianLars requested a review from a team as a code owner August 26, 2025 16:00
Copy link
Contributor

github-actions bot commented Aug 26, 2025

Package Changes Through b94f5dd

There are 2 changes which include updater with minor, updater-js with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.35 2.0.36
api-example-js 2.0.31 2.0.32
updater 2.9.0 2.10.0
updater-js 2.9.0 2.10.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@FabianLars
Copy link
Member Author

btw those schema changes are because i'm on windows. seems like we updated some dependency in the last few weeks?

Comment on lines 419 to 423
if let Some(installer) = installer_for_bundle_type(bundle_type()) {
url = url
.replace("%7B%7Bbundle_type%7D%7D", installer.name())
.replace("{{bundle_type}}", installer.name());
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this produce URLs with the placeholder still in it when the installer is None?

Say there's an endpoint like:

https://foo.example/update/my-app/{{target}}-{{arch}}/{{current_version}}?bundle_type={{bundle_type}}

Wouldn't that end up as:

https://foo.example/update/my-app/linux-x86_64/1.2.3?bundle_type={{bundle_type}}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep. any suggestions? Should we replace that with unknown ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using unknown is fine - though this should only happen in dev mode right? or if you run the target/release/app binary directly

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(and i raised this concern before, but we should avoid using unknowns ever - maybe use a default value in that case)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using unknown is fine - though this should only happen in dev mode right? or if you run the target/release/app binary directly

Yes, if the dev uses the tauri cli to package the app this should never be unknown. If they're using their own packaging system it'll show unknown (or the last created installer)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(and i raised this concern before, but we should avoid using unknowns ever - maybe use a default value in that case)

not sure i get what you mean. any kind of default value we set (assuming default means one of the existing types?) has a high chance to be incorrect.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep. any suggestions? Should we replace that with unknown ?

Having pulled the last of my hair out over Helm charts. The reasons this gets tricky is string templating.
To handle nullable values it pushes you down the route of conditional rendering or default values, and it's not fun 😬

So my first suggestion would be, think about alternatives that support nulls easily.
Like a header with these values in JSON.

As for {{bundle_type}}. I do think unknown would make it slightly more useful than say empty string because then you can use it in paths as well as query strings.

Copy link

@beanow-at-crabnebula beanow-at-crabnebula Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option could be we we don't support this as a {{bundle_type}} placeholder and instead only support this through the query string. Because we then can assume how query strings work, we can omit it when None.

So it's either:

  • https://foo.example/update/my-app/linux-x86_64/1.2.3
  • https://foo.example/update/my-app/linux-x86_64/1.2.3?bundle_type=appimage

Copy link
Member

@lucasfernog lucasfernog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is the best approach considering we want to align with the existing templating system (i.e. changing for custom query parameters etc would be a bigger change)

@FabianLars
Copy link
Member Author

agreed, though i do like the Headers idea but that's something for another PR.

@lucasfernog lucasfernog merged commit 8cf8eea into v2 Aug 27, 2025
18 checks passed
@lucasfernog lucasfernog deleted the feat/updater-installer-endpoint-replacement branch August 27, 2025 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants